package com.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.web.dao.SysNavDao;
import com.web.entity.SysNav;
import com.web.service.SysNavService;

@Service
public class SysNavServiceImpl implements SysNavService {

	@Autowired
	private SysNavDao sysNavDao;

	@Override
	public List<SysNav> queryAllsysNav() {

		return sysNavDao.queryAllsysNav();
	}

	@Override
	public List<SysNav> getAllNav() {

		return sysNavDao.getAllNav();
	}

	@Override
	public void addNav(String title, String icon, Integer state) {
		sysNavDao.addNav(title, icon, state);
	}

	@Override
	public Map<String, Object> changeNavState(Integer id, Integer state) {

		Map<String, Object> map = new HashMap<String, Object>();
		sysNavDao.updateNavState(id, state);
		map.put("result", 1);
		return map;
	}

	@Override
	public Map<String, Object> delRowNav(Integer id) {
		Map<String, Object> map = new HashMap<String, Object>();
		sysNavDao.detNav(id);
		map.put("result", 1);
		return map;
	}

}
